package com.tengju.motivation.domain.model.performance;

import lombok.Value;
import lombok.experimental.NonFinal;

import java.time.LocalDateTime;

/**
 * @author: 李大仙
 * @date: 2021/7/22 3:09 下午
 */
@Value
public class MotivationActivityConfig {

    private MotivationActivityConfigId activityId;

    @NonFinal
    private String title;

    @NonFinal
    private MotivationActivityConfigObjectTypeEnum objectType;

    @NonFinal
    private String remark;

    @NonFinal
    private LocalDateTime startTime;

    @NonFinal
    private LocalDateTime endTime;

    private String createBy;

    @NonFinal
    private String updateBy;

    public void edit(String title, Integer objectType, String remark, LocalDateTime startTime, LocalDateTime endTime, String staffName) {
        MotivationActivityConfigFactory.checkParam(title, objectType, startTime, endTime);
        this.title = title;
        this.objectType = MotivationActivityConfigObjectTypeEnum.form(objectType);
        this.remark = remark;
        this.startTime = startTime;
        this.endTime = endTime;
        this.updateBy = staffName;
    }
}
